.class public final Llt/farmis/libraries/shape_import_android/helpers/FileShapeHelper;
.super Llt/farmis/libraries/shape_import_android/helpers/BaseShapeHelper;
.source "FileShapeHelper.kt"


# direct methods
.method public constructor <init>()V
    .locals 0

    .line 10
    invoke-direct {p0}, Llt/farmis/libraries/shape_import_android/helpers/BaseShapeHelper;-><init>()V

    return-void
.end method

.method private final getFileReader(Llt/farmis/libraries/shape_import_android/ShapeImport$FileType;)Llt/farmis/libraries/shape_import_android/readers/AbsFileReader;
    .locals 1

    .line 75
    sget-object v0, Llt/farmis/libraries/shape_import_android/helpers/FileShapeHelper$WhenMappings;->$EnumSwitchMapping$1:[I

    invoke-virtual {p1}, Ljava/lang/Enum;->ordinal()I

    move-result p1

    aget p1, v0, p1

    const/4 v0, 0x1

    if-eq p1, v0, :cond_1

    const/4 v0, 0x2

    if-eq p1, v0, :cond_0

    const/4 p1, 0x0

    return-object p1

    .line 80
    :cond_0
    new-instance p1, Llt/farmis/libraries/shape_import_android/readers/FamFileReader;

    invoke-direct {p1}, Llt/farmis/libraries/shape_import_android/readers/FamFileReader;-><init>()V

    return-object p1

    .line 77
    :cond_1
    new-instance p1, Llt/farmis/libraries/shape_import_android/readers/KmlFileReader;

    invoke-direct {p1}, Llt/farmis/libraries/shape_import_android/readers/KmlFileReader;-><init>()V

    return-object p1
.end method


# virtual methods
.method public final readFile(Ljava/io/File;Llt/farmis/libraries/shape_import_android/ShapeImport$FileType;)Ljava/util/List;
    .locals 2
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/io/File;",
            "Llt/farmis/libraries/shape_import_android/ShapeImport$FileType;",
            ")",
            "Ljava/util/List<",
            "Llt/farmis/libraries/shape_import_android/models/ShapeModel;",
            ">;"
        }
    .end annotation

    const-string v0, "file"

    invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    const-string v0, "fileType"

    invoke-static {p2, v0}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    .line 66
    invoke-direct {p0, p2}, Llt/farmis/libraries/shape_import_android/helpers/FileShapeHelper;->getFileReader(Llt/farmis/libraries/shape_import_android/ShapeImport$FileType;)Llt/farmis/libraries/shape_import_android/readers/AbsFileReader;

    move-result-object p2

    const/4 v0, 0x0

    if-eqz p2, :cond_0

    const/4 v1, 0x1

    .line 68
    invoke-static {p1, v0, v1, v0}, Lkotlin/io/FilesKt;->readText$default(Ljava/io/File;Ljava/nio/charset/Charset;ILjava/lang/Object;)Ljava/lang/String;

    move-result-object p1

    invoke-virtual {p2, p1}, Llt/farmis/libraries/shape_import_android/readers/AbsFileReader;->read(Ljava/lang/String;)Z

    .line 69
    invoke-virtual {p2}, Llt/farmis/libraries/shape_import_android/readers/AbsFileReader;->getMeasurementModels()Ljava/util/List;

    move-result-object p1

    return-object p1

    :cond_0
    return-object v0
.end method
